import matplotlib.pyplot as plt
from matplotlib import animation
import random
import numpy as np
import time
from dev.T10 import T10

# plt.rcParams['font.sans-serif'] = ['SimHei']
# plt.rcParams['axes.unicode_minus'] = False
fig, ax = plt.subplots()             # Create a figure containing a single Axes.
plt.xlabel("Time")
plt.ylabel("Temperature")
plt.title("Temperature Curve")
plt.grid(True)
x = [1, 2, 3, 4]
y = [1, 4, 2, 3]
line, = ax.plot(x, y)
def init():
    line.set_ydata(y)  # Plot some data on the Axes.
    return line
def update(frame):
    global x, y
    y.append(random.randint(0, 4))
    y = y[1:]
    line.set_ydata(y)
    return line
ani = animation.FuncAnimation(fig, update, init_func=init, interval=1000, frames=10)
plt.show()                           # Show the figure.